const express = require('express')
const router = express.Router()
const expressJoi = require('@escook/express-joi')
const {add_post_comment_schema, del_post_comment_schema, update_post_comment_schema, get_post_comment_byPostid_shema} = require('../schema/postComment')

const postCommentHandler = require('../router_handler/postComment')

// 增
router.post('/addPostComment', expressJoi(add_post_comment_schema), postCommentHandler.addPostComment)
// 删
router.post('/delPostComment/:id', expressJoi(del_post_comment_schema), postCommentHandler.delPostComment)
// 改
router.post('/updatePostComment', expressJoi(update_post_comment_schema), postCommentHandler.updatePostComment)
// 查
router.get('/getPostCommentByPostId', expressJoi(get_post_comment_byPostid_shema), postCommentHandler.getPostCommentByPostId)

module.exports = router